package com.earnings.okhttputils.utils;

import com.earnings.okhttputils.utils.UrlConstant.HttpUrl;

import java.io.Serializable;

/**
 * 存取用户信息
 * Created by Administrator on 2017/3/24 0024.
 */

public class User implements Serializable {
    //是否登陆状态
    private boolean islogin;
    //是否登陆状态
    private boolean isFirst = true;
    private boolean DEBUG;

    private int debugcode;
    //手机号
    private String phone;
    //是否认证
    private boolean is_approve;

    private String user_id;//71,
    private String email;//""
    private String password;//"3d2066140f5a5dc09df51f1967a4f487"
    private String idcard_status;  //实名认证状态 0 未认证 时间戳 认证时间
    private String sex;//0
    private String birthday;//0
    private String user_money;//"0.00"
    private String frozen_money;//"0.00"
    private String distribut_money;//"0.00"
    private String pay_points;//0
    private String paypwd;//null
    private String reg_time;//1492163827
    private String last_login;//1493172035
    private String last_ip;//"113.12.139.111"
    private String qq;//""
    private String mobile;//"15977778974"
    private String mobile_validated;//1
    private String oauth;//""
    private String openid;//null
    private String unionid;//null
    private String head_pic;//null
    private String bank_name;//null
    private String bank_card;//null
    private String realname;//null
    private String idcard;//null
    private String email_validated;//0
    private String nickname;//"15977778974"
    private String level;//1
    private String discount;//"1.00"
    private String total_amount;//"0.00"
    private String is_lock;//0
    private String is_distribut;//1
    private String first_leader;//0
    private String second_leader;//0
    private String third_leader;//0
    private String parentid;//0
    private String parenttype;//0
    private String level_name;//"注册会员"
    private String token;//"228f2402dbe8ebd8a7bbb30887084806"
    private String rich;//"用户财币s
    private long codesecand;//上次发送验证码的时间
    private String green_lv; //1高级绿心 ，2超级绿心 默认为0

    private String withdrawal;// 16889.6,#可转入余额，可提现的总额
    private double lati;
    private double longa;
    private String city;
    private String area;

    private  String oilcard1;
    private  String oilcard2;

    public double getLati() {
        return lati;
    }

    public void setLati(double lati) {
        this.lati = lati;
    }

    public double getLonga() {
        return longa;
    }

    public void setLonga(double longa) {
        this.longa = longa;
    }

    public String getGreen_lv() {
        return green_lv;
    }

    public void setGreen_lv(String green_lv) {
        this.green_lv = green_lv;
    }

    private String freeze;// 4222.4,#可转入冻结，可消费的总额
    private String rate;// 0.8#财富转余额的转化率

    public User() {

    }

    public User(boolean islogin, boolean is_approve, String phone, String password, String address, String user_id, String sex, String user_money, String distribut_money, String reg_time, String nickname, String token, String head_pic, String realname, String idcard) {
        this.is_approve = is_approve;
        this.phone = phone;
        this.mobile = phone;
        this.user_id = user_id;
        this.sex = sex;
        this.user_money = user_money;
        this.distribut_money = distribut_money;
        this.reg_time = reg_time;
        this.nickname = nickname;
        this.token = token;
        this.head_pic = head_pic;
        this.realname = realname;
        this.idcard = idcard;
        this.password = password;
        this.islogin = islogin;
    }

    public boolean is_approve() {
        return is_approve;
    }

    public void setIs_approve(boolean is_approve) {
        this.is_approve = is_approve;
    }

    public String getPhone() {
        if (phone == null) return mobile;
        else if (phone.equals("")) return mobile;
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
        this.mobile = phone;
    }

    public String getWithdrawal() {
        return withdrawal;
    }

    public void setWithdrawal(String withdrawal) {
        this.withdrawal = withdrawal;
    }

    public String getFreeze() {
        return freeze;
    }

    public void setFreeze(String freeze) {
        this.freeze = freeze;
    }

    public String getRate() {
        return rate;
    }

    public void setRate(String rate) {
        this.rate = rate;
    }

    public String getUser_id() {
        return user_id;
    }

    public void setUser_id(String user_id) {
        this.user_id = user_id;
    }

    public String getOilcard1() {
        return oilcard1;
    }

    public void setOilcard1(String oilcard1) {
        this.oilcard1 = oilcard1;
    }

    public String getOilcard2() {
        return oilcard2;
    }

    public void setOilcard2(String oilcard2) {
        this.oilcard2 = oilcard2;
    }

    public String getSex() {
        if (sex.equals("1")) {
            return "男";
        } else if (sex.equals("2")) {
            return "女";
        } else if (sex.equals("0")) {
            return "保密";
        }
        return sex;
    }

    public void setSex(String sex) {
        if (sex.equals("男")) {
            sex = "1";
        } else if (sex.equals("女")) {
            sex = "2";
        } else if (sex.equals("保密")) {
            sex = "0";
        }
        this.sex = sex;
    }

    public String getUser_money() {
        return user_money;
    }

    public void setUser_money(String user_money) {
        this.user_money = user_money;
    }

    public String getDistribut_money() {
        return distribut_money;
    }

    public void setDistribut_money(String distribut_money) {
        this.distribut_money = distribut_money;
    }

    public String getReg_time() {
        return reg_time;
    }

    public void setReg_time(String reg_time) {
        this.reg_time = reg_time;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getHead_pic() {
        if (head_pic.indexOf("http") == -1) head_pic = HttpUrl.index + head_pic;
        return head_pic;
    }

    public void setHead_pic(String head_pic) {
        this.head_pic = head_pic;
    }

    public String getRealname() {
        return realname;
    }

    public void setRealname(String realname) {
        this.realname = realname;
    }

    public String getIdcard() {
        return idcard;
    }

    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public boolean islogin() {
        if (user_id == null) return false;
        else if (user_id.equals("")) return false;
        else return true;
    }

    public void setIslogin(boolean islogin) {
        this.islogin = islogin;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getIdcard_status() {
        return idcard_status;
    }

    public void setIdcard_status(String idcard_status) {
        this.idcard_status = idcard_status;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getFrozen_money() {
        return frozen_money;
    }

    public void setFrozen_money(String frozen_money) {
        this.frozen_money = frozen_money;
    }

    public String getPay_points() {
        return pay_points;
    }

    public void setPay_points(String pay_points) {
        this.pay_points = pay_points;
    }

    public String getPaypwd() {
        return paypwd;
    }

    public void setPaypwd(String paypwd) {
        this.paypwd = paypwd;
    }

    public String getLast_login() {
        return last_login;
    }

    public void setLast_login(String last_login) {
        this.last_login = last_login;
    }

    public String getLast_ip() {
        return last_ip;
    }

    public void setLast_ip(String last_ip) {
        this.last_ip = last_ip;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.phone = mobile;
        this.mobile = mobile;
    }

    public String getMobile_validated() {
        return mobile_validated;
    }

    public void setMobile_validated(String mobile_validated) {
        this.mobile_validated = mobile_validated;
    }

    public String getOauth() {
        return oauth;
    }

    public void setOauth(String oauth) {
        this.oauth = oauth;
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getUnionid() {
        return unionid;
    }

    public void setUnionid(String unionid) {
        this.unionid = unionid;
    }

    public String getBank_name() {
        return bank_name;
    }

    public void setBank_name(String bank_name) {
        this.bank_name = bank_name;
    }

    public String getBank_card() {
        return bank_card;
    }

    public void setBank_card(String bank_card) {
        this.bank_card = bank_card;
    }

    public String getEmail_validated() {
        return email_validated;
    }

    public void setEmail_validated(String email_validated) {
        this.email_validated = email_validated;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public String getDiscount() {
        return discount;
    }

    public void setDiscount(String discount) {
        this.discount = discount;
    }

    public String getTotal_amount() {
        return total_amount;
    }

    public void setTotal_amount(String total_amount) {
        this.total_amount = total_amount;
    }

    public String getIs_lock() {
        return is_lock;
    }

    public void setIs_lock(String is_lock) {
        this.is_lock = is_lock;
    }

    public String getIs_distribut() {
        return is_distribut;
    }

    public void setIs_distribut(String is_distribut) {
        this.is_distribut = is_distribut;
    }

    public String getFirst_leader() {
        return first_leader;
    }

    public void setFirst_leader(String first_leader) {
        this.first_leader = first_leader;
    }

    public String getSecond_leader() {
        return second_leader;
    }

    public void setSecond_leader(String second_leader) {
        this.second_leader = second_leader;
    }

    public String getThird_leader() {
        return third_leader;
    }

    public void setThird_leader(String third_leader) {
        this.third_leader = third_leader;
    }

    public String getParentid() {
        return parentid;
    }

    public void setParentid(String parentid) {
        this.parentid = parentid;
    }

    public String getParenttype() {
        return parenttype;
    }

    public void setParenttype(String parenttype) {
        this.parenttype = parenttype;
    }

    public String getLevel_name() {
        return level_name;
    }

    public void setLevel_name(String level_name) {
        this.level_name = level_name;
    }

    public String getRich() {
        return rich;
    }

    public void setRich(String rich) {
        this.rich = rich;
    }

    public long getCodesecand() {
        return codesecand;
    }

    public void setCodesecand(long codesecand) {
        this.codesecand = codesecand;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public boolean isFirst() {
        return isFirst;
    }

    public void setFirst(boolean first) {
        isFirst = first;
    }

    public boolean isDEBUG() {
        return DEBUG;
    }

    public void setDEBUG(boolean DEBUG) {
        this.DEBUG = DEBUG;
    }

    public int getDebugcode() {
        return debugcode;
    }

    public void setDebugcode(int debugcode) {
        this.debugcode = debugcode;
    }
}
